/*
 * 
 */



package com.itwill.ecom.boardQnAReply;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository("boardQnAReplyDao")
public class BoardQnAReplyDaoImpl implements BoardQnAReplyDao {
	
	private final static String namespace="com.itwill.ecom.boardQnAReply.BoardQnAReplyMapper";
	@Autowired
	private SqlSession session;
	
	public SqlSession getSession() {
		return session;
	}
	public void setSession(SqlSession session) {
		this.session = session;
		System.out.println("BoardQnAReplyDaoImpl 생성입니다.");
	}
	
	
	/********** 생성 ***********/
	@Override
	public int createBoardQnAReply(BoardQnAReplyBeans boardQnAReplyBeans) {
		
		return session.insert(namespace+".create_qnaboard_replay", boardQnAReplyBeans);
	}
	
	
	/********** 리스트호출 **********/
	@Override
	public List<BoardQnAReplyBeans> getAllBoardQnAReply() {
	
		return session.selectList(namespace+".list_qnaboard_reply");
	}
	
	
	/********** 내 게시물 검색 **********/
	@Override
	public List<BoardQnAReplyBeans> getById(String qnaboard_reply_id) {
		return session.selectList(namespace+".my_qnaboard_reply",qnaboard_reply_id);
	}
	
	
	/********** 내 게시물 수정 **********/
	@Override
	public int updateBoardQnAReply(BoardQnAReplyBeans boardQnABeans) {
		return session.insert(namespace+".update_qnaboard_reply", boardQnABeans);
	}
	
	
	/********** 내 게시물 삭제 **********/
	@Override
	public int deleteBoardQnAReply(int qnaboard_reply_no) {
		return session.delete(namespace+".delete_qnaboard_reply",qnaboard_reply_no);
	}
	/********** No로 게시글 검색 **********/
	@Override
	public List<BoardQnAReplyBeans> getByNo(int qnaboard_reply_group) {
		System.out.println("BoardQnAImpl부분임다"+qnaboard_reply_group);
		System.out.println(namespace);
		System.out.println("dao부분 세션값:"+session);
		List<BoardQnAReplyBeans> rrr=session.selectList(namespace+".detail_qnaboard_reply", qnaboard_reply_group);
		
		return  rrr;
	}

	
	

}
